    <div style="padding:20px">
        <table class="table table-condensed table-bordered table-hover" id="userOrder">
                <tr id="first_tr">
                 <td>订单号</td>
                 <td>下单用户</td>
                 <td>订单状态</td> 
                 <td>添加时间</td> 
                 <td>总计</td> 
                 <td>操作</td> 
               </tr>   
               <?php if(!empty($orderInfo) && is_array($orderInfo)):?> 
                    <?php foreach ($orderInfo as $k=>$v):?>
                          <tr class='secondTr'>
                              <td style="text-align: center;vertical-align: middle;">{$v['order_sn']}</td>
                              <td style="text-align: center;vertical-align: middle;">{$v['user_name']}</td>
                              <?php if($v['order_status'] == 0):?>
                                 <td style="text-align: center;vertical-align: middle;color: red" order_id="<?php echo $v['order_id']?>">未付款</td>
                                 <?php else:?>
                                  <td style="text-align: center;vertical-align: middle;color:green">已付款</td>
                              <?php endif;?>
                                  <td style="text-align: center;vertical-align: middle;"><?php echo date('Y-m-d H:i:s',$v['addtime'])?></td>
                                  <td style="text-align: center;vertical-align: middle;">{$v['total_price']}</td>                       
                               <?php if($v['order_status'] == 0):?>
                                  <td style="text-align: center;vertical-align: middle;"><button type="button" class="btn btn-default check" order_id="<?php echo $v['order_id']?>">更改为已付款</button></td>
                               <?php else:?>
                                  <td style="text-align: center;vertical-align: middle;"><button type="button" class="btn btn-default check" order_id="<?php echo $v['order_id']?>" disabled="disabled">已支付</button></td>
                              <?php endif;?>
                     </tr>
                     <?php endforeach;?>
             <?php endif;?>
        </table>
<div class="page23" style="width:500px;margin: 0 auto">{$page}</div>  

    <!--模态框开始-->
    <div class="modal fade" tabindex="-1" role="dialog" id="checkBox">
        <div class="modal-dialog" role="document">
          <div class="modal-content">
            <div class="modal-header">
              <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
              <h4 class="modal-title" id="checkTitle">友情提示</h4>
            </div>
              <div class="modal-body" id="checkContent">
                  请确认已收到货款!
              </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-danger" id="yes" data-dismiss="modal" order_id="">已确认</button>   
              <button type="button" class="btn btn-default" data-dismiss="modal">否</button>   
            </div>
          </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
  </div><!-- /.modal -->
  <!--模态框结束-->
    </div>
    <script>
        $(function(){
             $('.check').click(function(){
                  $(this).each(function(){
                        var order_id = $(this).attr('order_id');
                        $('#yes').attr('order_id',order_id);
                        $('#checkBox').modal('show');                        
                   })
             })    
               
               $('#yes').click(function(){
                            var order_id = $(this).attr('order_id');    
                            $.getJSON('<?php echo U("index/checkStatus")?>',{'order_id':order_id},function(e){
                                 if(e.status == 1){
                                     $('td[order_id='+order_id+']').css('color','green').html('已付款');
                                     $('.check[order_id='+order_id+']').html('已支付').attr('disabled','disabled');
                                 }
                            })
                        })
            
            
        })
    </script>
